<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>收货地址</title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../../../css/common.css" stylesheet" />
		<link rel="stylesheet" href="../../../../css/style.css" stylesheet" />
		<link rel="stylesheet" href="./css/index.css" />
	</head>
	<body>
		<div class="mui-content">
				<div class="main flex flexcenter">
				<div class="left">
					<span class="first">王</span>
				</div>
				<div class="center">
					<div class="user">
						<span class="name">王先生</span><span class="phone">
							18566669999
						</span>
						<i class="default">默认</i>
						<p>河南省 郑州市 金水区 黄河路1号璞丽中心B座</p>
					</div>
				</div>
				<div class="right">
					<i class="line"></i>
					<span class="edit" data-id="11">编辑</span>
				</div>
			</div>
			<div class="main flex flexcenter">
				<div class="left gray">
					<span class="first">王</span>
				</div>
				<div class="center">
					<div class="user">
						<span class="name">王先生</span><span class="phone">
							18566669999
						</span>
						<i class="default">默认</i>
						<p>河南省 郑州市 金水区 黄河路1号璞丽中心B座</p>
					</div>
				</div>
				<div class="right">
					<i class="line"></i>
					<span class="edit" data-id="22">编辑</span>
				</div>
			</div>
			<!-- 没有上面数据显示图片 -->
			<div class="none">
				<img src="../../../../images/nonedata/icon_default_address.png">
			</div>
			<div class="add">
				<span>添加收货地址</span>
			</div>
		</div>
	</body>
	<script src="../../../../js/mui.min.js"></script>
	<script src="../../../../js/jquery-3.4.1.min.js"></script>
	<script src="../../../../js/resize.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function($) {
			// 文档一加载就执行
			obj.setRem()
			// 窗口调节
			$(window).resize(function() {
				obj.setRem()
			});
			// 点击编辑跳转
			$('.edit').click(function(e) {
				console.log('e', e)
				let id = e.target.dataset.id
				console.log('当前Id', id)
				window.location.href = "./pages/edit/index.html?id=" + id + "&type=" + 'edit';
			})
			// 点击添加
			$('.add').click(function() {
				window.location.href = "./pages/edit/index.html?type=" + "add";
			})
			// 地址数据是否为空 0 为空
			let dataLen = $(".mui-content").find(".main").length
			console.log('dataLen',dataLen)
			if (dataLen == 0) {
				$('.none').css('display', 'block')
			} else {
				$('.none').css('display', 'none')
			}
		})
	</script>
</html>
